import instance from "./request";
// 分页获取退货原因设置
export const getRturnReasonData = (params: { pageNum: number, pageSize: number }): RES<IGetListResultModel> => {
  return instance({
    url: "returnReason/list",
    params
  })
}

// 修改是否可用 --批量修改
export const updateStatus = (params: { ids: number | number[], status: string }): RES<number> => {
  return instance({
    url: "returnReason/update/status",
    method: "POST",
    params
  })
}
// 删除退货原因
export const deleteReasonById = (params: { ids: number | number[] | string }): RES<number> => {
  return instance({
    url: "returnReason/delete",
    method: "POST",
    params
  })
}
// 获取单个退货原因详情信息
export const getOnlyReturnReasonByI = (id: number): RES<IGetOneModel> => {
  return instance({
    url: `returnReason/${id}`
  })
}

// 修改退货退货原因
export const updateReasonById = (data: { id: number, returnReason: IUpdateReasonModel }): RES<number> => {
  return instance({
    url: `returnReason/update/${data.id}`,
    method: 'POST',
    data: data.returnReason
  })
}

// 添加退货原因
export const addReason = (data: IUpdateReasonModel): RES<number> => {
  return instance({
    url: "returnReason/create",
    method: "POST",
    data
  })

}